Con esto podemos calcular el estimador como, \[\begin{equation} \tilde{\boldsymbol{\beta}}^{MCG} = (\mathbf{X}'\mathbf{F}'\mathbf{F}\mathbf{X})^{-1}(\mathbf{X}'\mathbf{F}'\mathbf{F}\mathbf{Y}) \end{equation}\] tal que, \[\begin{equation} \tilde{\boldsymbol{\beta}}^{MCG} = (\mathbf{X}'\Omega^{-1}\mathbf{X})^{-1}(\mathbf{X}'\Omega^{-1}\mathbf{Y}) \end{equation}\]
Sin embargo, muchas veces si bien la forma funcional de \(\Omega\) es conocida los parámetros de esta no lo son.
Cuando \(\Omega\) es desconocido necesitamos un estimador \(\hat{\Omega}\), tal que \[\begin{equation} \hat{\boldsymbol{\beta}}^{MCG} = (\mathbf{X}'\hat{\Omega}^{-1}\mathbf{X})^{-1}(\mathbf{X}'\hat{\Omega}^{-1}\mathbf{Y}) \end{equation}\] Este estimador es conocido como el estimador de MCG Factibles.
En la literatura de series de tiempo, los errores estandars robustos a correlación serial son a veces llamados, HAC, por sus siglas en ingles (heteroskedasticity and autocorrelation consistent)
Estos empezaron con el trabajo de Newey & West (1987), quienes buscaban tratar con el problema de correlación serial y heteroscedasticidad propio de las series de tiempo.
El procedimiento de Newey-West comienza por mirar la varianza de \(\hat{\beta}\),
\[\begin{equation} \Sigma_{\hat{\beta}} = (X'X)^{-1}Var(X' U| X) (X'X)^{-1} \end{equation}\]
Newey-West entonces relajan el supuesto de homoscedasticidad sobre \(Var(X' U| X)\)
Si los errores son heteroscedasticos pero independientes, entonces,
\[\begin{equation} \hat{Var}(X' U| X) = \Sigma_{i=1}^n \hat{u}_i^2 x_i x_i' \end{equation}\]
así los errores estandar del estimado MCO, serían:
\[\begin{equation} \Sigma_{\hat{\beta}} = (X'X)^{-1} (\Sigma_{i=1}^n \hat{u}_i^2 x_i x_i') (X'X)^{-1} \end{equation}\]
Si los errores son heteroscedasticos y tienen auto-correlación, entonces,
\[\begin{equation} \hat{Var}(X' U| X) = \Sigma_{i=-k}^k \frac{k-|j|}{k} \left(\Sigma_{t=1}^n \hat{u}_i \hat{u}_{i+j} x_i x_{i+j}'\right) \end{equation}\]
así los errores estandar del estimado MCO, serían:
\[\begin{equation} \Sigma_{\hat{\beta}} = (X'X)^{-1} \left(\Sigma_{i=-k}^k \frac{k-|j|}{k} \left(\Sigma_{t=1}^n \hat{u}_i \hat{u}_{i+j} x_i x_{i+j}'\right)\right) (X'X)^{-1} \end{equation}\]
library(readxl)
library(nlme)
USMacro <- read_excel(“us_macro_quarterly.xlsx”)
GLSReg <- gls(GDPC96 ~ GS10, data = USMacro, corr =
corAR1())
summary(GLSReg)
## New names:
## * `` -> ...1
## Generalized least squares fit by REML
## Model: GDPC96 ~ GS10
## Data: USMacro
## AIC BIC logLik
## 2679.966 2693.648 -1335.983
##
## Correlation Structure: AR(1)
## Formula: ~1
## Parameter estimate(s):
## Phi
## 0.9999998
##
## Coefficients:
## Value Std.Error t-value p-value
## (Intercept) 9322.662 132020.08 0.0706155 0.9438
## GS10 27.962 12.37 2.2596303 0.0248
##
## Correlation:
## (Intr)
## GS10 0
##
## Standardized residuals:
## Min Q1 Med Q3 Max
## -0.05027706 -0.03518528 -0.01537566 0.02032666 0.04973502
##
## Residual standard error: 132021.8
## Degrees of freedom: 228 total; 226 residual